package com.niodata.dp.core.hdfs.legacy;

import java.nio.file.Paths;
import java.util.Date;

public class DpFileStatus {

  private String path;
  private DpFilePermission permission;
  private long size;
  private String owner;
  private String group;
  private Date createTime;
  private boolean isDir;

  public DpFileStatus(String path, DpFilePermission permission, long size, String owner,
        String group, Date createTime, boolean isDir) {
    super();
    this.path = path;
    this.permission = permission;
    this.size = size;
    this.owner = owner;
    this.group = group;
    this.createTime = createTime;
    this.isDir = isDir;
  }

  public String getPath() {
    return path;
  }

  public void setPath(String path) {
    this.path = path;
  }

  public DpFilePermission getPermission() {
    return permission;
  }

  public void setPermission(DpFilePermission permission) {
    this.permission = permission;
  }

  public long getSize() {
    return size;
  }

  public void setSize(long size) {
    this.size = size;
  }

  public String getOwner() {
    return owner;
  }

  public void setOwner(String owner) {
    this.owner = owner;
  }

  public String getGroup() {
    return group;
  }

  public void setGroup(String group) {
    this.group = group;
  }

  public Date getCreateTime() {
    return createTime;
  }

  public void setCreateTime(Date createTime) {
    this.createTime = createTime;
  }

  public boolean isDir() {
    return isDir;
  }

  public void setDir(boolean isDir) {
    this.isDir = isDir;
  }

  public String getFileName() {
    return Paths.get(path).getFileName().toString();
  }
}